package com.primeton.wh.mcenter.impl.message.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.primeton.wh.mcenter.api.model.Message;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 消息表 服务类
 * </p>
 *
 * @author YunTao.Li
 * @since 2020-03-15
 */
public interface IMessageService {

    /**
     * 消息查询（分页）
     *
     * @param condition :
     * @return : com.baomidou.mybatisplus.core.metadata.IPage<com.primeton.wh.mcenter.impl.message.entity.Message>
     * @author : YunTao.Li
     * @date : 2020/3/17 2020/3/17
     */
    public IPage<Message> getMessageList(Map<String, Object> condition) throws Throwable;

    public Integer getUnReadMessageCount(Map<String, Object> condition) throws Throwable;

    public List<Message> getMessageListByApp(String appCode, String msgTo) throws Throwable;

    public List<Message> getUnreadMessageListByApp(String appCode, String msgTo) throws Throwable;

    public Message getMessageByApp(String appCode) throws Throwable;

    /**
     * 消息发送
     *
     * @param record :
     * @return : java.util.Map<java.lang.String,java.lang.String>
     * @author : YunTao.Li
     * @date : 2020/3/16 2020/3/16
     */
    public Map<String, String> sendMesage(Message record) throws Throwable;

    /**
     * 新增消息记录(持久化方法)
     *
     * @param record :
     * @return : java.util.Map<java.lang.String,java.lang.String>
     * @author : YunTao.Li
     * @date : 2020/3/16 2020/3/16
     */
    public Map<String, String> addMessage(Message record) throws Throwable;

    /**
     * 修改消息记录(持久化方法)
     *
     * @param record :
     * @return : java.util.Map<java.lang.String,java.lang.String>
     * @author : YunTao.Li
     * @date : 2020/3/16 2020/3/16
     */
    public Map<String, String> editMessage(Message record) throws Throwable;


    /**
     * 待生效的消息扫描仪，将待生效的message变成已生效的
     *
     * @return : java.util.Map<java.lang.String,Object>
     * @author : jinyabin
     * @date : 2020/8/13 2020/8/13
     */
    public Map<String, String> unEffectMessageScaner() throws Throwable;

    IPage<Message> selectMessage(Map<String, Object> condition)throws Throwable;
}
